function member_memberSave(strFlag) {
    var strMemberNo = "";
    var strDataVersion = "";
    if (strFlag == "2") {
        strMemberNo = getValue("hidMemberNo");
        strDataVersion = getValue("hidDataVersion");
    }
    ajaxRequest(getHost()+"member/memberEdit/save", {
        "MemberNo"    : strMemberNo,
        "MemberId"    : getValue("txtMemberId"),
        "MemberName"  : getValue("txtMemberName"),
        "SaleTp"        : getRadioValue("rdoSaleTp"),
        "ProvCode"      : getSelectedValue("selProv"),
        "City"          : getValue("txtCity"),
        "District"      : getValue("txtDistrict"),
        "MemberStatus"    : getRadioValue("rdoMemberStatus"),
        "MemberScale" : getRadioValue("rdoMemberScale"),
        "ContractNo"    : getValue("txtContractNo"),
        "Tel"           : getValue("txtTel"),
        "Mobile"        : getValue("txtMobile"),
        "Fax"           : getValue("txtFax"),
        "Email"         : getValue("txtEmail"),
        "QQ"            : getValue("txtQQ"),
        "MSN"           : getValue("txtMSN"),
        "Ali"           : getValue("txtAli"),
        "Homepage"      : getValue("txtHomepage"),
        "DataVersion"   : strDataVersion,
        "PaymentTp1"    : getRadioValue("rdoPaymentTp1"),
        "Account1"      : getValue("txtAccount1"),
        "PaymentTp2"    : getRadioValue("rdoPaymentTp2"),
        "Account2"      : getValue("txtAccount2"),
        "PaymentTp3"    : getRadioValue("rdoPaymentTp3"),
        "Account3"      : getValue("txtAccount3"),
        "Flag"          : strFlag
    }, member_memberCallback);
}

function member_memberDeleteConfirm() {
    Jconfirm(getMessage("INFO-00005"), null, member_memberDelete);
}

function member_memberDelete() {
    ajaxRequest(getHost()+"member/memberEdit/delete", {
        "MemberNo"    : getValue("hidMemberNo"),
        "DataVersion"   : getValue("hidDataVersion")
    }, member_memberCallback);
}

function member_memberCallback(data) {
    if(data.count != 0) {
        window.location.href=getHost()+"member/memberList/index/ReturnFg/" + data.ReturnFg;
    } else {
        Jconfirm(data.ReturnFg, null, member_memberDelete);
        setDisabled("btnSave", true);
        setDisabled("btnDelete", true);
    }
}

function member_paymentChecked(e) {
    setDisabled(e.name.replace("rdoPaymentTp","txtAccount"), getRadioValue(e.name) == "0");
}